/**
 * 
 */
package com.fox.webapp.persistent.custom;

import java.io.InputStream;
import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;

import com.fox.webapp.domain.Person;
import com.mongodb.gridfs.GridFSDBFile;
import com.mongodb.gridfs.GridFSFile;

/**
 * @author yockii
 *
 */
public interface PersonRepositoryCustom {

	Person updatePerson(Person p);
	
	Person updatePersonOnlyPassword(Person p);
	
	Person updatePersonOnlyBank(Person p);
	
	Person updatePersonEmailCode(Person person);
	
	Person updatePersonOnlyLastLoginIp(Person p);
	
	int countWithCondition(Person p);
	
	Page<Person> findPersonByCondition(Person p, Pageable pageRequest);
	
	Person addReferCommission(Person p, double money);
	
	Person decreaseBalance(Person p, double money);

	Person updatePersonOnlyQA(Person p);
	
	Person updateResetPasswordCode(Person person);
	
	Person updateEmailModifyCode(Person person);
	
	Person addCredit(Person person, double credit);
	
	GridFSFile storeQrcode(InputStream content, Person p);
	
	GridFSDBFile getQrcodeFile(Person p);
	
	void updatePersonIpWarning(Person... ps);
}
